package org.example.app.dao.model;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("public.user") // 使用 pg 需要加上 schema，养成好习惯
public class User implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String name;

    private String email;

    private String phone;

    private Integer status;

    private Date createdAt;

    private Date updatedAt;

    @AllArgsConstructor
    public enum COLUMNS {
        ID("id"),
        NAME("name"),
        EMAIL("email"),
        PHONE("phone"),
        STATUS("status"),
        CREATED_AT("created_at"),
        UPDATED_AT("updated_at");

        @Getter
        private final String column;
    }
}
